﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Stp.Core.Services
{
    public class LogoutService : ServiceBase
    {
        private IAccount _account;

        public LogoutService(AccountModel aModel) : this(new Account(aModel)) { }

        public LogoutService(IAccount account)
        {
            _account = account;
        }

        public override ActionResult Execute()
        {
            try
            {
                _account.Logout();
                BuildActionResult(true, string.Empty);
            }
            catch (Exception ex)
            {
                BuildActionResult(false, ex.Message);
            }

            return _aResult;
        }
    }
}
